//
//  ContentView.swift
//  WorldLandMark
//
//  Created by Felix Hi on 2021/6/28.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        print(UIScreen.main.bounds.width)
        print(UIScreen.main.bounds.height)
        print(UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? .zero)
        
        return NavigationView {
            List(landmarks, id: \.id) { landmark in
                NavigationLink(
                    destination: LandMarkDetail(landmark: landmark)
                ) {
                    Image(systemName: landmark.icon)
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                        .frame(width: 50, height: 80  , alignment: .center)
                        .cornerRadius(8.0)
                    VStack (alignment: .leading, spacing: nil, content: {
                        Text(landmark.name)
                        Text(landmark.location)
                            .font(.subheadline)
                            .foregroundColor(.secondary)
                    })
                }
            }.navigationBarTitle("世界地标")
        }
    }
}


struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
